package com.example.spb6;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;

import java.util.List;

public class Medicine {

    private String name;
    private String expirationDate;
    private List<String> intakeTimes;
    private String dosage;

    private int stock;
    // 增加同步状态字段
    private boolean synced;
    public Medicine(String name, String expirationDate, List<String> intakeTimes, String dosage,int stock) {
        this.name = name;
        this.expirationDate = expirationDate;
        this.intakeTimes = intakeTimes;
        this.dosage = dosage;
        this.stock = stock;
    }

    // 为向后兼容保留原来的构造方法
    public Medicine(String name, String expirationDate, List<String> intakeTimes, String dosage) {
        this(name, expirationDate, intakeTimes, dosage, 0);
    }


    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getExpirationDate() {
        return expirationDate;
    }

    public void setExpirationDate(String expirationDate) {
        this.expirationDate = expirationDate;
    }

    public List<String> getIntakeTimes() {
        return intakeTimes;
    }

    public void setIntakeTimes(List<String> intakeTimes) {
        this.intakeTimes = intakeTimes;
    }

    public String getDosage() {
        return dosage;
    }

    public void setDosage(String dosage) {
        this.dosage = dosage;
    }


    public int getStock() {
        return stock;
    }

    public void setStock(int stock) {
        this.stock = stock;
    }

    @Override
    public String toString() {
        return name;
    }


}

